# class MyClass:
#     x = 5
#
#
# p1 = MyClass()
# print(p1.x)


# class Person:
#     def __init__(self, name, age):
#         self.name = name
#         self.age = age
#
#     def myfunc(self):
#         print("Hello my name is " + self.name)
#         self.mf3()
#
#     def mf2(self):
#         self.myfunc()
#         print("Hello my age is " + str(self.age))
#
#     @staticmethod
#     def mf3():
#         print('mf3')
#
#
# p1 = Person("Bill", 63)
#
# print(p1.name)
# print(p1.age)
# p1.mf2()
#
# #  duck type


class Person:
    def __init__(self, fname, lname):
        self.firstname = fname
        self.lastname = lname

    def printname(self):
        print(self.firstname, self.lastname)


#
#
# # 使用 Person 来创建对象，然后执行 printname 方法：
#
# x = Person("Bill", "Gates")
# x.printname()
#
#
# class Student(Person):
#     def __init__(self, fname, lname):
#         super().__init__(fname, lname)
#         print('student')
#         self.graduationyear = 2019
#
#     def welcome(self):
#         print("Welcome", self.firstname, self.lastname, "to the class of", self.graduationyear)
#
#
# def func1():
#     pass
#
#
# def func2():
#     pass
#
#
# x = Student("Elon", "Musk")
# x.printname()
# print(x.graduationyear)
# x.welcome()

# mytuple = ("apple", "banana", "cherry")
# myit = iter(mytuple)
# #
# # for it in myit:
# #     print(it)
#
# print(next(myit))
# print(list(myit))

# import mymodule
# import mymodule as m
# from test.mymodule import greeting as g
# g('Bill')
#
# print(dir(g))
# print(dir(iter))


# import datetime
#
# x = datetime.datetime.now()
# # print(x)
# # print(x.year)
# # print(x.strftime("%A"))
#
# print(x.timestamp())
# print(x.tzname())
# print(dir(x))
# print(x.strftime('%Y-%m-%d'))
# y = datetime.datetime.strptime('2021-11-05', '%Y-%m-%d')
# print(y)


# import json
#
# x = '{ "name":"Bill", "age":63, "city":"Seatle"}'
# y = json.loads(x)
# print(y["age"])
#
# x = {
#   "name": "Bill",
#   "age": 63,
#   "city": "Seatle"
# }
#
# # 转换为 JSON：
# y = json.dumps(x)
#
# with open('y.json', 'w') as f:
#     json.dump(y, f)
#
# with open('y.json', 'r') as f1:
#     y1 = json.load(f1)
#     print(y1)
#
# # 结果是 JSON 字符串：
# print(y)

# x = input('Input something: ')
# print(x)

# x = 3.65769898
# print(f'{x:.2f}')

import os
print(dir(os))
for d in os.listdir('.'):
    print(d)

p = os.path.join('.', 'test')
print(p)
